-
Notifications
You must be signed in to change notification settings - Fork 436
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
ddtrace: make UseLogger public #1466
Conversation
Make the internal UseLogger function public so that users can specify a single logger for all tracer and profiler logs. Right now the profiler doesn't have a configurable logger, and the tracer has the WithLogger option, which sets the global logger anyway. Fixes #1331.
Is there a way to get the old Logger interface so it can be restored? The new public UseLogger function does not return anything compared to the internal's UseLogger. Without having access to the original logger, I can't perform the original functionality without copy-pasting the code from internal |
I suppose we could consider adding a |
I'm trying to silence the internal diagnostics like
Basically, in addition to implementing my own logger, I also want the option to invoke the old one based on any logic I choose. |
I see, so what you're looking for is something like a
where
|
Correct, I want a Just from a design standpoint, it seems unusual that Yeah I looked through (I got a bit lost in the separation between log and ddtrace/internal/log) and it looks like the internal log is actually directly opening FD2 (stderr) and writing the logs to it. Which means if my custom logger needed to emulate that behavior, I would also need to open 2 or just call the original handler, something like this is what I want to do:
|
Make the internal
UseLogger
function public so that users can specify asingle logger for all tracer and profiler logs. Right now the profiler
doesn't have a configurable logger, and the tracer has the WithLogger
option, which sets the global logger anyway.
Fixes #1331.